<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变框</title>



    <style>
        * {
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }

        html {
            width: 100%;
            height: 100vh;
        }

        body {
            background-color: rgb(0, 0, 0);
        }

        .inside_wrap {
            overflow: hidden;
            position: absolute;
            width: 200px;
            height: 400px;
            border-radius: 50%;
        }

        .inside {
            position: absolute;
            top: -72px;
            left: -132px;
            width: 500px;
            height: 500px;
            border-radius: 50%;
            /* background-image: linear-gradient(0deg, rgb(255, 251, 0) 10%, #f76f6f9f 20%, #9dc1f87a, #f8f7c054, #fdfdfd00); */
            /* background-image: linear-gradient(0deg, rgb(255, 0, 0) 10%, #f76f6f9f 20%, #ffffff7a, #ffffff54, #fdfdfd00); */
            background-image: linear-gradient(0deg, rgb(255, 0, 0) 40%, #610000 60%);
            /* background-image: linear-gradient(0deg, rgb(255, 0, 0) 10%, #ff3c00 20%, #ff7300, #ffa702, #ffee00); */
            transform: rotate(0deg);
        }

        .outside {
            position: absolute;
            top: 4px;
            left: 4px;
            width: 192px;
            height: 392px;
            border-top-left-radius: 50%;
            border-bottom-right-radius: 50%;
            /* background-color: rgb(0, 0, 0); */
            background-image: linear-gradient(135deg, rgb(0, 0, 0)8%, rgb(143, 0, 0), rgb(202, 0, 0), rgb(143, 0, 0), rgb(0, 0, 0));
        }

        .wrap {
            position: relative;
            margin: 50px auto;
            width: 200px;
            height: 200px;
        }
    </style>

</head>

<body>

    <div class="wrap">
        <div class="inside_wrap">
            <div class="inside"></div>
        </div>
        <div class="outside"></div>
    </div>




    <script>
        function rotateAni() {
            let inside = document.querySelector('.inside');
            let angle = 0;
            let move = setInterval(() => {
                angle += 5;
                inside.style.transform = `rotate(${angle}deg)`
                if (angle === 720) {
                    clearInterval(move);
                    rotateAni();
                }
            }, 30)
        }
        rotateAni();
    </script>



</body>

</html>